import { reactive, ref } from 'vue'
import { onLoad, onReachBottom,onReady } from '@dcloudio/uni-app'

export const usePageHeaderForm = function(header_ref) {

  const headerForm = header_ref
  const CC_PAGE_STYLE = reactive({
    '--header-height':0
  })

  onReady(()=>{
    if(headerForm.value){
      const {height} = headerForm.value.getBoundingClientRect()
      CC_PAGE_STYLE['--header-height'] = `${height}px`
    }
  })

  return {
    CC_PAGE_STYLE
  }
}
